<template>
    <div>
        <el-table
            :data="tableData"
            tooltip-effect="dark"
            style="width: 100%"
            height="300" >
            <el-table-column  type="index" width="55"></el-table-column>
            <el-table-column  prop="msgId"  label="传输标识"  width="180"></el-table-column>
            <el-table-column  prop="issuedType"  label="类型"  width="200"></el-table-column>
            <el-table-column  prop="retCode"  label="操作结果代码"  width="120"></el-table-column>
            <el-table-column  prop="creationDate"  label="返回时间"  width="120"></el-table-column>
            <el-table-column  prop="bData"  label="ERP返回结果"   show-overflow-tooltip></el-table-column>
            <el-table-column  prop="result"  label="操作结果"  width="120"></el-table-column>
        </el-table>
        <!--分页-->
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="page.currentPage"
            :page-sizes="page.pageRandom"
            :page-size="page.pageSize"
            layout="total, sizes, prev, pager, next"
            :total="page.total">
        </el-pagination>
    </div>
</template>

<script>
import request from "@/utils/request.js";
export default {
    name:"ErpBackTable",
    data(){
        return{
            queryParam:{},//查询参数
            page:{
                currentPage:1,
                pageSize:20,
                total:0,
                pageRandom:[50,100,500]
            },
            tableData:[]
        }
    },
    methods:{
        handleSizeChange(val){
            this.page.pageSize = val;
            this.$options.methods.relaodTable.bind(this)();
        },
        handleCurrentChange(val){
            this.page.currentPage = val;
            this.$options.methods.relaodTable.bind(this)();
        },
        relaodTable(){
            var that = this;
            request.post("/erpLogRest/queryBackLog",{"queryParam":this.queryParam,"page":this.page}).then((res)=>{
                that.page.total = res.data.total;
                that.tableData = res.data.list;
            });
        }

    },
    mounted(){
        var that = this;
        this.$bus.$on("loadBackTable",(param)=>{
            that.queryParam.msgId = param.msgId;
            that.$options.methods.relaodTable.bind(that)();
        })
    }
}
</script>